home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / Scrap.p < prev    next >
Text File  |  1996-05-01  |  7KB  |  186 lines

  1. {
  2.      File:        Scrap.p
  3.  
  4.      Contains:    Scrap Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Scrap;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __SCRAP__}
  28. {$SETC __SCRAP__ := 1}
  29.  
  30. {$I+}
  31. {$SETC ScrapIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __FILEMANAGER__}
  38. {$I FileManager.p}
  39. {$ENDC}
  40.  
  41. {$PUSH}
  42. {$ALIGN MAC68K}
  43. {$LibExport+}
  44.  
  45. {
  46. _________________________________________________________________________________________________________
  47.  * STUCTURES
  48. _________________________________________________________________________________________________________
  49. }
  50.  
  51. TYPE
  52.     ScrapRef = ^LONGINT;
  53.     ScrapItemUserReference                = UInt32;
  54.     ScrapItemType                        = OSType;
  55. {$IFC FOR_SYSTEM8_PREEMPTIVE }
  56. {
  57. _________________________________________________________________________________________________________
  58.  * SCRAP ITEM TYPE ATTRIBUTES
  59. _________________________________________________________________________________________________________
  60. }
  61.     ScrapItemTypeAttributes                = OptionBits;
  62.  
  63. CONST
  64.     kScrapItemTypeNoAttributes    = $00;                            {  No scrap item type attributes }
  65.     kScrapItemTypeSenderOnly    = $01;                            {  Scrap item type is available to sender only }
  66.     kScrapItemTypeSenderTranslated = $02;                        {  Scrap item type is translated by sender }
  67.     kScrapItemTypeNotSaved        = $04;                            {  Scrap item type should not be saved }
  68.     kScrapItemTypeSystemTranslated = $0100;                        {  Scrap item type is translated by Scrap Manager }
  69.  
  70. {
  71. _________________________________________________________________________________________________________
  72.  * FSOBJECTREF SCRAP ITEM TYPE
  73. _________________________________________________________________________________________________________
  74. }
  75.     kScrapItemTypeFSObject        = 'fsob';                        {  scrap item type for FSObjectRef data }
  76.  
  77.  
  78. TYPE
  79.     FSObjectScrapItemTypePtr = ^FSObjectScrapItemType;
  80.     FSObjectScrapItemType = RECORD
  81.         objectInfo_o:            FSObjectInformation;                    {  FSObject information }
  82.         object_t:                FSObjectRef;                            {  FSObjectRef - Call FSObjectRefRegister() before using }
  83.     END;
  84.  
  85. {
  86. _________________________________________________________________________________________________________
  87.     
  88.  * FSOBJECTREF PROMISE SCRAP ITEM TYPE
  89. _________________________________________________________________________________________________________
  90. }
  91.  
  92. CONST
  93.     kScrapItemTypePromiseFSObject = 'pfob';                        {  Scrap item type for promised FSObjectRef data }
  94.  
  95.  
  96. TYPE
  97.     PromiseFSObjectScrapItemTypePtr = ^PromiseFSObjectScrapItemType;
  98.     PromiseFSObjectScrapItemType = RECORD
  99.         objectInfo_o:            FSObjectInformation;                    {  FSObject information }
  100.         promisedScrapItemType:    ScrapItemType;                            {  Promised scrap item type containing an FSObjectRef }
  101.     END;
  102.  
  103. {
  104. _________________________________________________________________________________________________________
  105.  * CREATING & DELETING SCRAPS
  106. _________________________________________________________________________________________________________
  107. }
  108. FUNCTION NewScrapRef(VAR scrapReference: ScrapRef): OSStatus; C;
  109. FUNCTION DisposeScrapRef(scrapReference: ScrapRef): OSStatus; C;
  110. {
  111. _________________________________________________________________________________________________________
  112.  * ADDING SCRAP ITEMS
  113. _________________________________________________________________________________________________________
  114. }
  115. FUNCTION AddScrapItemType(scrapReference: ScrapRef; newOrExistingUserReference: ScrapItemUserReference; newItemType: ScrapItemType; data: UNIV Ptr; dataSize: ByteCount): OSStatus; C;
  116. FUNCTION SetScrapItemTypeData(scrapReference: ScrapRef; existingUserReference: ScrapItemUserReference; existingItemType: ScrapItemType; data: UNIV Ptr; dataSize: ByteCount; dataOffset: UInt32): OSStatus; C;
  117. FUNCTION SetScrapItemTypeAttributes(scrapReference: ScrapRef; existingUserReference: ScrapItemUserReference; existingItemType: ScrapItemType; attributes: ScrapItemTypeAttributes): OSStatus; C;
  118. FUNCTION SetScrapItemTypePromiseHint(scrapReference: ScrapRef; existingUserReference: ScrapItemUserReference; existingItemType: ScrapItemType; userPromiseHint: UInt32): OSStatus; C;
  119. {
  120. _________________________________________________________________________________________________________
  121.  * GETTING SCRAP ITEM INFORMATION
  122.      NOTE: ALL INDEXES ARE 1 BASED (1 .. N)
  123. _________________________________________________________________________________________________________
  124. }
  125. FUNCTION CountScrapItems(scrapReference: ScrapRef; VAR numberScrapItems: ItemCount): OSStatus; C;
  126. FUNCTION GetScrapItem(scrapReference: ScrapRef; scrapItemIndex: UInt32; VAR userReference: ScrapItemUserReference): OSStatus; C;
  127. FUNCTION CountScrapItemTypes(scrapReference: ScrapRef; userReference: ScrapItemUserReference; VAR numberItemTypes: ItemCount): OSStatus; C;
  128. FUNCTION GetScrapItemType(scrapReference: ScrapRef; userReference: ScrapItemUserReference; itemTypeIndex: UInt32; VAR itemType: ScrapItemType): OSStatus; C;
  129. FUNCTION GetScrapItemTypeDataSize(scrapReference: ScrapRef; userReference: ScrapItemUserReference; itemType: ScrapItemType; VAR itemTypeDataSize: ByteCount): OSStatus; C;
  130. FUNCTION GetScrapItemTypeData(scrapReference: ScrapRef; userReference: ScrapItemUserReference; itemType: ScrapItemType; data: UNIV Ptr; VAR dataSize: ByteCount; VAR dataOffset: UInt32): OSStatus; C;
  131. FUNCTION GetScrapItemTypeAttributes(scrapReference: ScrapRef; userReference: ScrapItemUserReference; itemType: ScrapItemType; VAR attributes: ScrapItemTypeAttributes): OSStatus; C;
  132. {$ENDC}
  133. {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED }
  134. {
  135. _________________________________________________________________________________________________________
  136.  * CLASSIC SCRAP MANAGER API
  137. _________________________________________________________________________________________________________
  138. }
  139.  
  140. TYPE
  141.     ScrapStuffPtr = ^ScrapStuff;
  142.     ScrapStuff = RECORD
  143.         scrapSize:                SInt32;
  144.         scrapHandle:            Handle;
  145.         scrapCount:                SInt16;
  146.         scrapState:                SInt16;
  147.         scrapName:                StringPtr;
  148.     END;
  149.  
  150.     PScrapStuff                            = ^ScrapStuff;
  151. FUNCTION InfoScrap: ScrapStuffPtr;
  152.     {$IFC NOT GENERATINGCFM}
  153.     INLINE $A9F9;
  154.     {$ENDC}
  155. FUNCTION UnloadScrap: SInt32;
  156.     {$IFC NOT GENERATINGCFM}
  157.     INLINE $A9FA;
  158.     {$ENDC}
  159. FUNCTION LoadScrap: SInt32;
  160.     {$IFC NOT GENERATINGCFM}
  161.     INLINE $A9FB;
  162.     {$ENDC}
  163. FUNCTION GetScrap(hDest: Handle; theType: ResType; VAR offset: SInt32): SInt32;
  164.     {$IFC NOT GENERATINGCFM}
  165.     INLINE $A9FD;
  166.     {$ENDC}
  167. FUNCTION ZeroScrap: SInt32;
  168.     {$IFC NOT GENERATINGCFM}
  169.     INLINE $A9FC;
  170.     {$ENDC}
  171. FUNCTION PutScrap(length: SInt32; theType: ResType; source: UNIV Ptr): SInt32;
  172.     {$IFC NOT GENERATINGCFM}
  173.     INLINE $A9FE;
  174.     {$ENDC}
  175. {$ENDC}
  176. {$ALIGN RESET}
  177. {$POP}
  178.  
  179. {$SETC UsingIncludes := ScrapIncludes}
  180.  
  181. {$ENDC} {__SCRAP__}
  182.  
  183. {$IFC NOT UsingIncludes}
  184.  END.
  185. {$ENDC}
  186.